Skip to content

Yuliya_Rock_LL #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Yuliya_Rock_LL #4

wants to merge 2 commits into from

Conversation

yukka-pukka
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Yuliya, you hit the learning goals here. Well done.

Comment on lines +14 to +18
constructor() {
// The # before the variable name indicates
// a private variable.
this.#head = null;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +23 to -25
Time Complexity: O(1)
Space Complexity: O(1)
*/
getFirst() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Very clever use of syntax

Comment on lines +34 to +37
Time Complexity: O(1)
Space Complexity: O(1)
*/
addFirst(value) {
throw new Error("This method hasn't been implemented yet!");
}
addFirst(value) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +44 to +47
Time Complexity: O(1)
Space Complexity: O(1)
*/
search(value) {
throw new Error("This method hasn't been implemented yet!");
search(value) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 The time complexity is O(n) here since you have to traverse the whole list.

Comment on lines +58 to +61
Time Complexity: O(n)
Space Complexity: O(1)
*/
length() {
throw new Error("This method hasn't been implemented yet!");
length() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +111 to +114
Time Complexity: O(n)
Space Complexity: O(1)
*/
addLast(value) {
throw new Error("This method hasn't been implemented yet!");
addLast(value) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +133 to +136
Time Complexity: O(n)
Space Complexity: O(1)
*/
findMax() {
throw new Error("This method hasn't been implemented yet!");
findMax() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +148 to +151
Time Complexity: O(n)
Space Complexity: O(1)
*/
delete(value) {
throw new Error('This method has\'t been implemented yet!')
delete(value) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +174 to +177
Time Complexity: O(n)
Space Complexity: O(1)
*/
visit() {
const helper_list = []
current = this.#head;

while (current) {
helper_list.push(current.value);
current = current.next;
}
visit() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +192 to +195
Time Complexity: O(n)
Space Complexity: O(1)
*/
reverse() {
throw new Error("This method hasn't been implemented yet!");
reverse() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants